<?php

namespace App\Http\Controllers\v3;

use App\Models\FormIds;
use App\Models\LogTimes;
use Carbon\Carbon;

/**
 * 消息推送
 * Class CateController
 * @package App\Http\Controllers
 */
class FormController extends Controller {


    public function index(){
        $form_id = (string)request('form_id','');
        $openid= (string)request('openid','');
        $user = $this->getUser($openid);
        if($form_id && ($form_id !='the formId is a mock one')){
            //统计formid
            $form = [
                'created_at' => Carbon::now(),
                'expires_at' => Carbon::now()->addHours(160),
                'formid'     => $form_id,
                'openid'     => $openid,
                'userid'     => $user['id'],
            ];
            FormIds::create($form);
            return $this->returnJson(0);
        }
        return $this->returnJson(1,'数据非法');
    }



}
